
package org.darcy.model;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.*;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.darcy.framework.model.PageParam;
import org.darcy.entity.BizType;

@ApiModel("文章分类: BizTypeModel")
@Getter
@Setter
public class BizTypeModel extends PageParam implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id
	@Column(name = "ID")
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@ApiModelProperty(value = "")
	private Long id;

	@ApiModelProperty(value = "")
	private Long pid;

	@ApiModelProperty(value = "文章类型名")
	private String name;

	@ApiModelProperty(value = "类型介绍")
	private String description;

	@ApiModelProperty(value = "排序")
	private Integer sort;

	@ApiModelProperty(value = "图标")
	private String icon;

	@ApiModelProperty(value = "分类在web端显示的位置，可选：nav、scrollmenu")
	private String position;

	@ApiModelProperty(value = "是否可用")
	private Byte available;

	@ApiModelProperty(value = "添加时间")
	private Date createTime;

	@ApiModelProperty(value = "更新时间")
	private Date updateTime;

	/**
	 * model类转化为mybatis plus 查询条件
	 */
	public QueryWrapper<BizType> buildWrapper() {
		QueryWrapper<BizType> p = new QueryWrapper<BizType>();
		return p;
	}

	@ApiModelProperty(value = "上级分类")
	private BizType parent;

	@ApiModelProperty(value = "下级分类")
	private List<BizType> nodes;

}
